<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<th:block layout:fragment="pagination">
<script  th:inline="javascript">
    function goToPage(page) {
        var form = $([[${formSelecter}]])[0];
        $([['[name='+${pageParmName}+']']]).val(page);
        form.submit();
    }
</script>
<span class="total-num">共<span th:text="${page.totalElements}"></span>条数据</span>
<ul class="pagination">
    <li th:onclick="'javascript:goToPage(1)'" th:class="${page.number+1 == 1}?disabled:''"><span>«</span></li>

    <li th:onclick="'javascript:goToPage('+${i}+')'" th:each="i:${#numbers.sequence(page.number+1-6,page.number+6)}" th:if="${i>0 and i<=page.totalPages}" th:class="${page.number+1 == i}?'active':''"><a href="javascript:void(0)" th:text="${i}"></a></li>

    <li th:onclick="'javascript:goToPage('+${page.totalPages}+')'" th:class="${page.number+1 == page.totalPages}?disabled:''"><a th:href="'javascript:void(0)'"  rel="next">»</a></li>
</ul>
</th:block>
